function k2=component(k)
% opponent: Calculate opponent player's index for a two-player game
%
% SYNTAX:
%   k2 = opponent(k)
%   Return 2 if k=1; or 1 if k=2

%   Author: Hongbin Ma
%   Last updated: 2009-6-1 with MATLAB 6.5
%   Problems or suggestions? Email me: mathmhb[at]163.com

k2=3-k;
